package com.qf.controller;

import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/user")
@CrossOrigin(value = {"http://locahost:9090"})
//@CrossOrigin(value = {"http://localhost:9090"})
public class UserController {
//    @RequestMapping(value = "/{id}",method = RequestMethod.GET)
    @GetMapping("/{id}")
    public String findById(@PathVariable("id") Integer id) {
        System.out.println("findById:" + id);
        return "success";
    }
//    @RequestMapping(value = "/{id}",method = RequestMethod.DELETE)
    @DeleteMapping("/{id}")
    public String delById(@PathVariable("id") Integer id) {
        System.out.println("delById:" + id);
        return "success";
    }
    @PostMapping("/")
    public String add(@RequestBody Map<String,Object> map) {
        System.out.println("add:" + map);
        return "success";
    }
    @PutMapping("/")
    public String update(@RequestBody Map<String,Object> map) {
        System.out.println("update:" + map);
        return "success";
    }
}
